<!-- 报告编审及审核 -->
<template>
  <div>
    <Card :bordered="false">
      <Row>
        <Col span="14">报告编制情况表</Col>
        <Col span="2"><Button :disabled="tofStateOne" @click="firstInstance" type="text">一审</Button></Col>
        <Col span="2"><Button :disabled="tofStateTwo" @click="secondInstance" type="text">二审</Button></Col>
        <Col span="2"><Button :disabled="tofStateThr" @click="firstTrial" type="text">初审</Button></Col>
        <Col span="2"><Button :disabled="tofStateFou" @click="reExamine" type="text">复审</Button></Col>
        <Col span="2"><Button :disabled="tofStateFiv" @click="lastInstance" type="text">终审</Button></Col>
      </Row>
        <Form ref="form" :model="info" :rules="rules">
          <table id="reportReview" width='100%' border="1" cellspacing="0" cellpadding="0" ref="print">
            <tr>
              <th colspan="6">
                报告编制情况表
              </th>
            </tr>
            <tr>
              <td width="270">
                项目编号
              </td>
              <td colspan="5"  class='sizeStyle'>
                {{info.ProjectNumber}}
              </td>
            </tr>
            <tr>
              <td>
                <Icon type="ios-medical" color="#ff6868" />
                项目名称
              </td>
              <td colspan="5"  class='sizeStyle'>
                {{info.ProjectName}}
                <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'projectName')" v-if='projectNameList.length>0'/>
                <Oldname v-if="projectName" :oldName="projectNameList"></Oldname>
                <!-- <FormItem prop="Project_name">
                  <Input v-model="info.Project_name"></Input>
                </FormItem> -->
              </td>
            </tr>
            <tr>
              <td>
                <Icon type="ios-medical" color="#ff6868" />
                建设单位
              </td>
              <td colspan="5">
                <FormItem prop="BuildUnit">
                  <Input v-model="info.BuildUnit" :disabled='viewOnly'></Input>
                </FormItem>
                <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'buildName')" v-if='buildNameList.length>0'/>
                <Oldname v-if="buildName" :oldName="buildNameList"></Oldname>
              </td>
            </tr>
            <tr>
              <td>
                <Icon type="ios-medical" color="#ff6868" />
                报告类型
              </td>
              <td colspan="3"  class='sizeStyle'>
                {{info.ReportType}}
                <!-- <FormItem prop="Report_type">
                  <Input v-model="info.Report_type"></Input>
                </FormItem> -->
              </td>
              <td width="300">
                <Icon type="ios-medical" color="#ff6868" />
                联系人
              </td>
              <td>
                <FormItem prop="Linkman">
                  <Input v-model="info.Linkman" :disabled='viewOnly'></Input>
                </FormItem>
                <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'Linkman')" v-if='LinkmanList.length>0'/>
                <Oldname v-if="Linkman" :oldName="LinkmanList"></Oldname>
              </td>
            </tr>
            <tr>
              <td>
                项目负责人
              </td>
              <td colspan="3">
                <Input v-model="info.PerjectLeader" :disabled='viewOnly'></Input>
              </td>
              <td>
                项目组成员
              </td>
              <td class='sizeStyle'>
                <!-- <Input v-model="info.Linkman" :disabled='viewOnly'></Input> -->
                {{cyz}}
              </td>
            </tr>
            <tr>
              <td rowspan="14">
                初稿
              </td>
              <td rowspan="14">
                报告
              </td>
              <td colspan="2">
                正文
              </td>
              <td>
                <Button @click="downData" type="default" :disabled='viewOnly'>新建报告</Button>
              </td>
              <td>
                <Col span="12"><UploadFile v-model="info.TextReport" :upName="upInfo.TextReport" UploadFileName="TextReport" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
                <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.TextReport"></DownloadButton></Col>
              </td>
            </tr>
            <tr>
              <td rowspan="5" colspan="2">
                附件
              </td>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                委托书
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <!-- <Col span="16"> -->
                  <!-- <Alert type="success" show-icon>土地文件.doc</Alert> -->
                  <!-- </Col> -->
                  <Col span="12">
                  <FormItem prop="ProjectTrustInstrument">
                    <UploadFile v-model="info.ProjectTrustInstrument" :upName="upInfo.ProjectTrustInstrument" UploadFileName="ProjectTrustInstrument" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
                  </FormItem>
                  </Col>
                  <Col span="12">
                    <DownloadButton v-if="viewOnly" :downData="downloadInfo.ProjectTrustInstrument"></DownloadButton>
                  </Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                备案/立项文件
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <!-- <Col span="16">
                  <Alert type="success" show-icon>土地文件.doc</Alert>
                  </Col> -->
                  <Col span="12">
                  <FormItem prop="CreateProjectDoc">
                    <UploadFile v-model="info.CreateProjectDoc" :upName="upInfo.CreateProjectDoc" UploadFileName="CreateProjectDoc" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
                  </FormItem>
                  </Col>
                  <Col span="12">
                    <DownloadButton v-if="viewOnly" :downData="downloadInfo.CreateProjectDoc"></DownloadButton>
                  </Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                土地文件
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <!-- <Col span="16">
                  <Alert type="success" show-icon>土地文件.doc</Alert>
                  </Col> -->
                  <Col span="12">
                  <FormItem prop="LandDoc">
                    <UploadFile v-model="info.LandDoc" :upName="upInfo.LandDoc" UploadFileName="LandDoc" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
                  </FormItem></Col>
                  <Col span="12">
                    <DownloadButton v-if="viewOnly" :downData="downloadInfo.LandDoc"></DownloadButton>
                  </Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                规划文件
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <!-- <Col span="16">
                  <Alert type="success" show-icon>土地文件.doc</Alert>
                  </Col> -->
                  <Col span="12">
                  <FormItem prop="PlanningDoc">
                    <UploadFile v-model="info.PlanningDoc" :upName="upInfo.PlanningDoc" UploadFileName="PlanningDoc" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
                  </FormItem>
                  </Col>
                  <Col span="12">
                  <DownloadButton v-if="viewOnly" :downData="downloadInfo.PlanningDoc"></DownloadButton>
                  </Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                执行标准函
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <!-- <Col span="16">
                  <Alert type="success" show-icon>土地文件.doc</Alert>
                  </Col> -->
                    <Col span="12"><UploadFile v-model="info.AStandardLetter" :upName="upInfo.AStandardLetter" UploadFileName="AStandardLetter" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
                    <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.AStandardLetter"></DownloadButton></Col>
                </Row>
              </td>
            </tr>
            <!-- <tr>
              <td colspan="3">
                <Row>
                  <Col span="24">
                  <Button style="margin-right: 20px" type="info">添加</Button><Button type="error">删除</Button>
                  </Col>
                </Row>
              </td>
            </tr> -->
            <tr>
              <td rowspan="5" colspan="2">
                附图
              </td>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                地理位置图
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <Col span="12"><FormItem prop="PlanningDoc">
                    <UploadFile v-model="info.CoordinateMap" :upName="upInfo.CoordinateMap" UploadFileName="CoordinateMap" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
                  </FormItem></Col>
                  <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.CoordinateMap"></DownloadButton></Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                周围环境概况图
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <Col span="12"><UploadFile v-model="info.ProjectOverview" :upName="upInfo.ProjectOverview" UploadFileName="ProjectOverview" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
                  <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.ProjectOverview"></DownloadButton></Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                项目平面分布图
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <Col span="12"><UploadFile v-model="info.ProjectFlatMap" :upName="upInfo.ProjectFlatMap" UploadFileName="ProjectFlatMap" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
                  <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.ProjectFlatMap"></DownloadButton></Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                项目监测布点图
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  <Col span="12"><UploadFile v-model="info.ActualMonitorPointMap" :upName="upInfo.ActualMonitorPointMap" UploadFileName="ActualMonitorPointMap" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
                  <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.ActualMonitorPointMap"></DownloadButton></Col>
                </Row>
              </td>
            </tr>
            <tr>
              <!-- <td>
                <Checkbox label="twitter" :disabled='viewOnly'>
                </Checkbox>
              </td> -->
              <td>
                <!-- <Icon type="ios-medical" color="#ff6868" /> -->
                项目水系图
              </td>
              <td>
                <Row type="flex" justify="center" align="middle" class="code-row-bg">
                  
                  <Col span="12"><UploadFile v-model="info.RiverSystemMap" :upName="upInfo.RiverSystemMap" UploadFileName="RiverSystemMap" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
                  <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.RiverSystemMap"></DownloadButton></Col>
                  
                </Row>
              </td>
            </tr>
            <tr>
              <td>
                附表
              </td>
              <td colspan="3" style="text-align:left">
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="8">
                      <Button @click="downInfo" type="info" ghost>基础信息表</Button>
                    </Col>
                    <Col span="8">
                      <UploadFile v-model="info.BasicInformation" :upName="upInfo.BasicInformation" UploadFileName="BasicInformation" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
                    </Col>
                    <Col span="8">
                      <DownloadButton v-if="viewOnly" :downData="downloadInfo.BasicInformation"></DownloadButton>
                    </Col>
                </Row>
              </td>
            </tr>
          </table>
        </Form>
        <Row style="padding:20px 0">
          <Col span="12" style="text">
          <PrintButton v-if="flag" Url="print/printFormation" :Project_id="info.Id"></PrintButton>
          </Col>
          <Col span="12" style="text-align: right">
          <Button type="primary" @click="submit('save')" :disabled='viewOnly'>
            保存
          </Button>
          <Button type="primary" @click="submit('submit')" :disabled='viewOnly'>
            提交审核
          </Button>
          </Col>
        </Row>
      </p>
      <StepBar :status="4" :viewOnly='viewOnly'/>
    </Card>
  </div>
</template>
<script>
  import libs from "../../../libs/uploads";
  export default {
    data() {
      return {
        // 项目名称、建设单位、法人、联系人、联系电话留痕列表
        projectName: false,
        buildName: false,
        Linkman: false,
        projectNameList: [], 
        buildNameList: [],     
        LinkmanList: [],
        tofStateOne: true,
        tofStateTwo: true,
        tofStateThr: true,
        tofStateFou: true,
        tofStateFiv: true,
        viewOnly: false,  // 允许查看
        flag: false,
        info: {},
        rules: {
          ProjectName: {
            required: true,
            trigger: 'blur',
            message: '内容不能为空',
          },
          BuildUnit: {
            required: true,
            trigger: 'blur',
            message: '内容不能为空',
          },
          ReportType: {
            required: true,
            trigger: 'blur',
            message: '内容不能为空',
          },
          Linkman: {
            required: true,
            trigger: 'blur',
            message: '内容不能为空',
          },
          ProjectTrustInstrument: {

          },
          CreateProjectDoc: {

          },
          LandDoc: {

          },
          PlanningDoc: {

          },
        },
        upInfo: {
          newFile: "",
          ProjectTrustInstrument: "",                                                 //委托书
          CreateProjectDoc: "",                                                       //备案/立项文件
          LandDoc: "",
          PlanningDoc: "",
          AStandardLetter: "",
          CoordinateMap: "",
          ProjectOverview: "",                                                     //项目周围环境概况图    
          ProjectFlatMap: "",                                                         //项目平面分布图
          ActualMonitorPointMap: "",                                                 //项目监测布点图
          RiverSystemMap: "",
          BasicInformation: "",
          TextReport: "",
        },
        downloadInfo: {},
        cyz: '',  //组成员
        updatedInfo: 0,
        setButton: 0,
      }
    },
    created() {
      //判断是否有ID
      if (this.$route.query.ProjectId && this.$route.query.ProjectId != '') {
        this.getProject(this.$route.query.ProjectId)
        if(this.$route.query.viewOnly==1 || localStorage.getItem('userOrg') ==7) {
          this.viewOnly = true
        }
      } else {
        //跳转首页
        this.$router.push({
          name: "index"
        })
      }
      this.findStaffs()
    },
    methods: {
      // 获取组成员信息
      findStaffs() {
        axios.get('/audit/findStaffs2', {
          params: {
            ProjectId: this.$route.query.ProjectId
          }
        }).then(res => {
          // console.log(res)
          this.cyz = res.data
        })
      },
      // 名字去重显示
      viewClick(e,nameShow) {
        if(!this[nameShow]) {
          e.target.className = 'ivu-icon ivu-icon-ios-arrow-up'
        }else {
          e.target.className = 'ivu-icon ivu-icon-ios-arrow-down'
        }
        this[nameShow] = !this[nameShow]
      },
      ok() {
        this.$Message.info("Clicked ok");
      },
      cancel() {
        this.$Message.info("Clicked cancel");
      },
      addData() {
        this.data1.push({
          name: "项目负责人",
          address: "负责的章节"
        })
      },
      /* 获取当前创建项目 */
      getProject(Id) {
        this.$post('ProjectInfo.findProjectByID', {
            Id
        }).then(res => {
          if(res.info.Tof == 0){
            this.tofStateOne = true
            this.tofStateTwo = true
            // console.log(res.info)
            var n = res.info.PerjectType
            switch(true)
            {
              case n == 8:
                this.tofStateThr = false;
                break;
              case n == 9:
                this.tofStateThr = false;
                this.tofStateFou = false;
                break;
              case n >= 10:
                this.tofStateThr = false;
                this.tofStateFou = false;
                this.tofStateFiv = false;
                break;
            }
          }else{
            var n = res.info.PerjectType
            switch(true)
            { 
              case n == 6:
                this.tofStateOne = false;
                break;
              case n == 7:
                this.tofStateOne = false;
                this.tofStateTwo = false;
                break
              case n == 8:
                this.tofStateOne = false;
                this.tofStateTwo = false;
                this.tofStateThr = false;
                break;
              case n == 9:
                this.tofStateOne = false;
                this.tofStateTwo = false;
                this.tofStateThr = false;
                this.tofStateFou = false;
                break;
              case n >=10:
                this.tofStateOne = false;
                this.tofStateTwo = false;
                this.tofStateThr = false;
                this.tofStateFou = false;
                this.tofStateFiv = false;
                break;
              default:
                this.tofStateOne = true;
                this.tofStateTwo = true;
                this.tofStateThr = true;
                this.tofStateFou = true;
                this.tofStateFiv = true;
                break;
            }
          }
          this.downloadInfo = res.doc
          console.log(this.downloadInfo)
          this.info = res.info
          if(res.pt2List.length>0) {
            var arrAll = res.pt2List //所有更改记录
            function arrayUnique2(arr, ProjectName) {
              var hash = {};
              return arr.reduce(function (item, next) {
                hash[next[ProjectName]] ? '' : hash[next[ProjectName]] = true && item.push(next);
                return item;
              }, []);
            }
            var projectNameList = arrayUnique2(arrAll, "ProjectName")
            if(projectNameList[0].ProjectName==this.info.ProjectName) {
              projectNameList = arrayUnique2(arrAll, "ProjectName").slice(1)
            }
            projectNameList.forEach(e => {
              this.projectNameList.push({name: e.ProjectName,Operator: e.Operator,UpdateTime: e.UpdateTime})
            });

            var buildNameList = arrayUnique2(arrAll, "BuildUnit")
            if(buildNameList[0].BuildUnit==this.info.BuildUnit) {
              buildNameList = arrayUnique2(arrAll, "BuildUnit").slice(1)
            }
            buildNameList.forEach(e => {
              this.buildNameList.push({name: e.BuildUnit,Operator: e.Operator,UpdateTime: e.UpdateTime})
            });
            
            var LinkmanList =  arrayUnique2(arrAll, "Linkman")
            if(LinkmanList[0].Linkman==this.info.Linkman) {
              LinkmanList =  arrayUnique2(arrAll, "Linkman").slice(1)
            }
            LinkmanList.forEach(e => {
              this.LinkmanList.push({name: e.Linkman,Operator: e.Operator,UpdateTime: e.UpdateTime})
            });           
          }
          
          this.info.PerjectLeader = res.PerjectLeader
          localStorage.projectType = this.info.PerjectType
          this.flag = true
          this.upInfo.ProjectTrustInstrument = this.upWord(res.doc.ProjectTrustInstrument)
          this.upInfo.CreateProjectDoc = this.upWord(res.doc.CreateProjectDoc)
          this.upInfo.LandDoc = this.upWord(res.doc.LandDoc)
          this.upInfo.PlanningDoc = this.upWord(res.doc.PlanningDoc)
          this.upInfo.AStandardLetter = this.upWord(res.doc.AStandardLetter)
          this.upInfo.CoordinateMap = this.upWord(res.doc.CoordinateMap)
          this.upInfo.ProjectOverview = this.upWord(res.doc.ProjectOverview)
          this.upInfo.ProjectFlatMap = this.upWord(res.doc.ProjectFlatMap)
          this.upInfo.ActualMonitorPointMap = this.upWord(res.doc.ActualMonitorPointMap)
          this.upInfo.RiverSystemMap = this.upWord(res.doc.RiverSystemMap)
          this.upInfo.BasicInformation = this.upWord(res.doc.BasicInformation)
          this.upInfo.TextReport = this.upWord(res.doc.TextReport)
        }).catch((err)=>{
          console.log(err)
          this.$Message.error('请求失败！')
        })
      },
      // 保存 save / 提交 submit
      submit(type) {
        // 验证
        if(type == 'save'){
          if(this.setButton == 0){
            this.setButton = 1
            setTimeout(()=>{this.setButton = 0},60000)
            this.$refs.form.validate((valid) => {
            if (!valid) {
              return
            }
            let info = this.info
            info.BtnWay = type == 'save' ? 1 : 2
            info.PerjectType = type == 'save' ? 5 : 5
              axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
                if (res._STATUS == 1) {
                  let title = res._MESSAGE
                  if (type == 'save') {
                    this.$Modal.success({
                      title,
                    })
                  } else {
                    // 如果是总公司为跳入三审 分公司跳入五审核
                    if (info.Tof == 0) {
                      this.$router.push({
                        name: "firstTrial",
                        query: {
                          ProjectId: this.$route.query.ProjectId,
                          Atype: 2,
                        }
                      })
                    } else {
                      this.$router.push({
                        name: "firstInstance",
                        query: {
                          ProjectId: this.$route.query.ProjectId,
                          Atype: 0,
                        }
                      })
                    }
                  }
                } else {
                  // 提示
                  this.$Modal.error({
                    title:res._MESSAGE
                  })
                }
              })
            })
          }else{
            this.$Message.warning('连续点击保存时间过短，最少间隔1分钟!')
          }
        }else{
          if(this.updatedInfo == 0){
            this.updatedInfo = 1
            setTimeout(()=>{this.updatedInfo = 0},60000)
            this.$refs.form.validate((valid) => {
            if (!valid) {
              return
            }
            let info = this.info
            info.BtnWay = type == 'save' ? 1 : 2
            info.PerjectType = type == 'save' ? 5 : 5
              axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
                if (res._STATUS == 1) {
                  let title = res._MESSAGE
                  if (type == 'save') {
                    this.$Modal.success({
                      title,
                    })
                  } else {
                    // 如果是总公司为跳入三审 分公司跳入五审核
                    if (info.Tof == 0) {
                      this.$router.push({
                        name: "firstTrial",
                        query: {
                          ProjectId: this.$route.query.ProjectId,
                          Atype: 2,
                        }
                      })
                    } else {
                      this.$router.push({
                        name: "firstInstance",
                        query: {
                          ProjectId: this.$route.query.ProjectId,
                          Atype: 0,
                        }
                      })
                    }
                  }
                } else {
                  // 提示
                  this.$Modal.error({
                    title:res._MESSAGE
                  })
                }
              })
            })
          }else{
            this.$Message.warning('连续点击提交时间过短，最少间隔1分钟!')
          }
        }

        // if(this.setButton == 0){
        //   this.setButton = 1
        //   setTimeout(()=>{this.setButton = 0},60000)
        
        // this.$refs.form.validate((valid) => {
        //   if (!valid) {
        //     return
        //   }

        //   let info = this.info
        //   // if(this.updatedInfo <= 2){
        //   //   this.$Message.warning('未修改数据无法提交')
        //   //   return
        //   // }
        //   info.btn_way = type == 'save' ? 1 : 2
        //   info.Perject_type = type == 'save' ? 5 : 5

        //   console.log(this.info)
        //   axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
        //     if (res._STATUS == 1) {
        //       let title = res._MESSAGE
        //       if (type == 'save') {
        //         this.$Modal.success({
        //           title,
        //         })
        //       } else {
        //         // 如果是总公司为跳入三审 分公司跳入五审核
        //         if (info.Tof == 0) {
        //           this.$router.push({
        //             name: "firstTrial",
        //             query: {
        //               Project_id: this.$route.query.Project_id,
        //               Atype: 2,
        //             }
        //           })
        //         } else {
        //           this.$router.push({
        //             name: "firstInstance",
        //             query: {
        //               Project_id: this.$route.query.Project_id,
        //               Atype: 0,
        //             }
        //           })
        //         }

        //       }
        //     } else {
        //       // 提示
        //       this.$Modal.error({
        //         title:res._MESSAGE
        //       })
        //     }
        //   })
        // })
        // }else{
        //   this.$Message.warning('请勿重复提交!')
        // }
      },
      // 下载新建报告
      downData(){
        window.open(libs.uploads2() + 'fileUpload/download2?Name=环评报告表模板.doc')
      },
      downInfo(){
        // axios.post('fileUpload/download2',{
        //   name: '建设项目环评审批基础信息表V1013版.xlsx'
        // }).then((res)=>{
        //   console.log(res)
        // })
        window.open(libs.uploads2() + 'fileUpload/download2?Name=建设项目环评审批基础信息表 V1013版.xlsx')
      },
      upWord(url){        //分割字符串
        if(url == null){
          return '上传'
        }else{
          var upWord = url;
          upWord = upWord.split("/");
          upWord = upWord.slice(-1);
          upWord = upWord.join('');
          // console.log(upWord)
          return upWord
        }
      },
      firstInstance(){              //一审
        this.$router.push({name: 'firstInstance',query: { ProjectId: this.$route.query.ProjectId,Atype: 0,viewOnly: this.viewOnly?1:0}})
      },
      secondInstance(){
        this.$router.push({name: 'secondInstance',query: {ProjectId: this.$route.query.ProjectId,Atype: 1,viewOnly: this.viewOnly?1:0}})
      },
      firstTrial(){
        this.$router.push({name: 'firstTrial',query: {ProjectId: this.$route.query.ProjectId,Atype: 2,viewOnly: this.viewOnly?1:0}})
      },
      reExamine(){
        this.$router.push({name: 'reExamine',query: {ProjectId: this.$route.query.ProjectId,Atype: 3,viewOnly: this.viewOnly?1:0}}) 
      },
      lastInstance(){
        this.$router.push({name: 'lastInstance',query: {ProjectId: this.$route.query.ProjectId,Atype: 4,viewOnly: this.viewOnly?1:0}})
      },
    },
  }
</script>
<style lang="less">
  #reportReview {
    td.sizeStyle {
      font-size:12px;
    }
    textarea.ivu-input {
      font-size: 12px;
    }
    .ivu-input {
      border: none !important;
      text-align: center;
      height: 30px;

      input {
        outline: medium;
      }
    }
    .ivu-input[disabled], fieldset[disabled] .ivu-input {
      background-color: #fff; 
      color: #333;
      font-size: 12px;
    }
    .ivu-select-disabled .ivu-select-selection {
      background-color: #fff;
      color: #333;
      border: 0;
    }
  }
</style>